const express = require('express');
const router = express.Router();
router.get('/', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `2019${i}`,
        code: `string-${i}`,
        brandCode: 'PP',
        brandName: '品牌1',
        dutyUnitCode: 'GYS',
        dutyUnitName: '供应商1',
        partCode: 'BJ-0001',
        partName: 'string-0001',
        replacedPartCode: 'THJ-0001',
        replacedPartName: 'string-THJ-0001',
        status: 1,
        remark: 'string',
        rowVersion: 'string',
        options: ['update', 'abandon']
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.post('/', (req, res) => {
    res.json({
        message: '新增'
    });
});
router.put('/:id/abandon', (req, res) => {
    res.json({
        message: '作废'
    });
});
router.put('/:id', (req, res) => {
    res.json({
        message: '编辑'
    });
});
router.get('/:id', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            id: '1',
            code: 'WXSP2019082700-1',
            brandId: '1',
            brandCode: 'PP',
            brandName: '品牌1',
            dutyUnitId: '1',
            dutyUnitCode: 'GYS',
            dutyUnitName: '供应商1',
            partId: '1',
            partCode: 'BJ-0001',
            partName: 'string-0001',
            replacedPartId: '1',
            replacedPartCode: 'THJ-0001',
            replacedPartName: 'string-THJ-0001',
            status: 1,
            remark: 'string',
            rowVersion: 'string',
            options: ['update', 'abandon'],
            details: [
                {
                    productCategeryId: '1',
                    productCategeryCode: 'JJ0001'
                },
                {
                    productCategeryId: '2',
                    productCategeryCode: 'JJ0002'
                },
                {
                    productCategeryId: '3',
                    productCategeryCode: 'JJ0003'
                }
            ]
        }
    });
});
module.exports = router;
